<?php

namespace App\Validators\Teacher;

use App\Validators\PassesValidator;
use \Prettus\Validator\Contracts\ValidatorInterface;
use \Prettus\Validator\LaravelValidator;

class CertificateValidator extends LaravelValidator
{
    use PassesValidator;
    protected $rulesMessages=[
        'teacher_id.required' => '教师ID不能为空',
        'sponsor.required' => '主办方是必填的',
        'title.required'  => '活动名称是必填的',
        'awards_name.required'  => '奖项是必填的',
        'score.required'  => '名次/得分是必填的',
        'acquire_date.required'   =>  '获得时间是必填',
        'electron_attachment.required'   =>  '证书电子件是必传的',
    ];
    protected $rules = [
        ValidatorInterface::RULE_CREATE => [
            'teacher_id'=>'required',
            'sponsor'=>'required',
            'title'=>'required',
            'awards_name'=>'required',
            'score'=>'required',
            'acquire_date'=>'required',
            'electron_attachment'=>'required',
        ],
        ValidatorInterface::RULE_UPDATE => [],
   ];
}
